<template>
    <div class="add-equipment">
        <div class="form-section">
            <h3>基本信息</h3>
            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>会议名称</label>
                </div>
                <div>
                    <p class="textarea">{{detailData.MeetingName}}</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>会议类型</label>
                </div>
                <div>
                    <p>{{detailData.MeetingType}}</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>会议时间</label>
                </div>
                <div>
                    <p>{{detailData.MeetingDate}}</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>会议地点</label>
                </div>
                <div>
                    <p>{{detailData.MeetingPosition}}</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>数据汇总范围</label>
                </div>
                <div>
                    <p>{{detailData.StartDate?`${detailData.StartDate.split(' ')[0]} ~ ${detailData.EndDate.split(' ')[0]}`:''}}</p>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3 @click="openChild(detailData.HiddenDanger)">
                <span>隐患管理</span>
                <x-icon type="ios-arrow-down"
                        size="30"
                        class="icon-right"
                        v-show="detailData.HiddenDanger&&detailData.HiddenDanger.open"></x-icon>
                <x-icon type="ios-arrow-up"
                        size="30"
                        class="icon-right"
                        v-show="detailData.HiddenDanger&&!detailData.HiddenDanger.open"></x-icon>
            </h3>
            <div v-show="detailData.HiddenDanger&&detailData.HiddenDanger.open">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>登记隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[0]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>已关闭隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[1]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>待整改隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[2]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>逾期未整改隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[3]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>待复查隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[4]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>隐患整改率</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[5]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>隐患一次性整改率</label>
                    </div>
                    <div>
                        <p>{{detailData.HiddenDanger?detailData.HiddenDanger[6]:''}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3 @click="openChild(detailData.SafetyCheck)">
                <span>安全检查</span>
                <x-icon type="ios-arrow-down"
                        size="30"
                        class="icon-right"
                        v-show="detailData.SafetyCheck&&detailData.SafetyCheck.open"></x-icon>
                <x-icon type="ios-arrow-up"
                        size="30"
                        class="icon-right"
                        v-show="detailData.SafetyCheck&&!detailData.SafetyCheck.open"></x-icon>
            </h3>
            <div v-show="detailData.SafetyCheck&&detailData.SafetyCheck.open">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>项目级安全检查</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[0]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>分子公司级安全检查</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[1]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>公司级安全检查</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[2]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>项目级发现隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[3]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>分子公司级发现隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[4]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>公司级发现隐患</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[5]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>项目级下发整改通知单</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[6]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>分子公司级下发整改通知单</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[7]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>公司级下发整改通知单</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[8]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>公司级下发设备停用单</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[9]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>公司级下发停工通知单</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyCheck?detailData.SafetyCheck[10]:''}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3 @click="detailData.brokenRuleOpen = !detailData.brokenRuleOpen;$forceUpdate()">
                <span>违章管理</span>
                <x-icon type="ios-arrow-down"
                        size="30"
                        class="icon-right"
                        v-show="detailData.brokenRuleOpen"></x-icon>
                <x-icon type="ios-arrow-up"
                        size="30"
                        class="icon-right"
                        v-show="!detailData.brokenRuleOpen"></x-icon>
            </h3>
            <div v-show="detailData.brokenRuleOpen">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>违章管理</label>
                    </div>
                    <div>
                        <p>{{detailData.BrokenRule?detailData.BrokenRule:''}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3 @click="openChild(detailData.SafetyTrain)">
                <span>安全教育培训</span>
                <x-icon type="ios-arrow-down"
                        size="30"
                        class="icon-right"
                        v-show="detailData.SafetyTrain&&detailData.SafetyTrain.open"></x-icon>
                <x-icon type="ios-arrow-up"
                        size="30"
                        class="icon-right"
                        v-show="detailData.SafetyTrain&&!detailData.SafetyTrain.open"></x-icon>
            </h3>
            <div v-show="detailData.SafetyTrain&&detailData.SafetyTrain.open">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>教育培训次数</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyTrain?detailData.SafetyTrain[0]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>接受教育培训人数</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyTrain?detailData.SafetyTrain[1]:''}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3 @click="openChild(detailData.Exposal)">
                <span>安全曝光</span>
                <x-icon type="ios-arrow-down"
                        size="30"
                        class="icon-right"
                        v-show="detailData.Exposal&&detailData.Exposal.open"></x-icon>
                <x-icon type="ios-arrow-up"
                        size="30"
                        class="icon-right"
                        v-show="detailData.Exposal&&!detailData.Exposal.open"></x-icon>
            </h3>
            <div v-show="detailData.Exposal&&detailData.Exposal.open">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>安全红榜</label>
                    </div>
                    <div>
                        <p>{{detailData.Exposal?detailData.Exposal[0]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>安全黑榜</label>
                    </div>
                    <div>
                        <p>{{detailData.Exposal?detailData.Exposal[1]:''}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3 @click="openChild(detailData.SafetyAccident)">
                <span>事故事件</span>
                <x-icon type="ios-arrow-down"
                        size="30"
                        class="icon-right"
                        v-show="detailData.SafetyAccident&&detailData.SafetyAccident.open"></x-icon>
                <x-icon type="ios-arrow-up"
                        size="30"
                        class="icon-right"
                        v-show="detailData.SafetyAccident&&!detailData.SafetyAccident.open"></x-icon>
            </h3>
            <div v-show="detailData.SafetyAccident&&detailData.SafetyAccident.open">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>发生事故</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyAccident?detailData.SafetyAccident[0]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>轻伤</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyAccident?detailData.SafetyAccident[1]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>重伤</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyAccident?detailData.SafetyAccident[2]:''}}</p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>死亡</label>
                    </div>
                    <div>
                        <p>{{detailData.SafetyAccident?detailData.SafetyAccident[3]:''}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3>
                <span>会议决定事项</span>
            </h3>
        </div>
        <myMenu></myMenu>
    </div>
</template>
<script>
import upload from '@/commonComponents/upload/index'
import myMenu from '@/commonComponents/menu'
export default {
    name: 'meetingRecordDetail',
    data () {
        return {
            userInfo: {},
            detailData: {}
        }
    },
    components: {
        upload,
        myMenu
    },
    created () {
        this.userInfo = JSON.parse(localStorage.getItem('userInfo')) || {}
        this.getDetail()
    },
    methods: {
        openChild (item) {
            this.$set(item, 'open', !item.open)
        },
        getDetail () {
            let params = {
                'allowPaging': true,
                'business': 'GetSafetyMeeting', // --业务类型参数 2: 例会详细
                'data': {
                    'businessType': '2',
                    'id': this.$route.query.id
                },
                'pageIndex': 0,
                'pageSize': 0,
                'tokenId': '',
                'userId': this.userInfo.userid
            }
            this.$axiosAjax.getConfigJson(params)
                .then((res) => {
                    if (res.data.code === 0) {
                        this.detailData = res.data.data
                    }
                }).catch((response) => {
                })
        }
    }
}
</script>
<style scoped>
.form-section h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.select-section {
    display: flex;
}
.select-section div {
    padding-left: 26px;
    background: url(../../../static/images/select.png) no-repeat left center;
    background-size: 17px 17px;
}
.select-section div:first-child {
    margin-right: 58px;
}
.select-section .active {
    background: url(../../../static/images/selected.png) no-repeat left center;
    background-size: 17px 17px;
}
.add-equipment .label-title1 {
    width: 168px;
    line-height: 18px;
}
</style>
